﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeBehind="CodeTableManagement.aspx.cs" Inherits="SEP.Admin.CodeTableManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <link href="../Styles/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">        
        $(function() { 
            $("#tabs").tabs({ 
                show: function() { 
                    var sel = $('#tabs').tabs('option', 'selected'); 
                    $("#<%= hidLastTab.ClientID %>").val(sel); 
                }, 
                selected: <%= hidLastTab.Value %> 
            }); 
        }); 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphTitle" runat="server">
    Code Table Management
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphBody" runat="server">
    <asp:Label ID="lblMessage" runat="server" ForeColor="Red" />
    <div id="tabs">
        <ul>
            <li><a href="#tab-phones">Phones</a></li>
            <li><a href="#tab-addresses">Addresses</a></li>
            <li><a href="#tab-emailaddresses">Email Addresses</a></li>
            <li><a href="#tab-relationships">Relationships</a></li>
            <li><a href="#tab-instruments">Instruments</a></li>
            <li><a href="#tab-manufacturers">Manufacturers</a></li>
        </ul>
        <div id="tab-phones">
            Description:
            <asp:TextBox ID="txtDescriptionPhone" runat="server" MaxLength="100" />
            <asp:LinkButton ID="lnkAddPhone" Text="Add" runat="server" OnClick="lnkAddPhone_Click" />
            <br />
            <br />
            <asp:GridView ID="grvPhones" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                OnRowEditing="grvPhones_EditRecord" OnRowUpdating="grvPhones_UpdateRecord" OnRowDataBound="grvPhones_RowDataBound"
                OnRowCancelingEdit="grvPhones_CancelRecord" OnRowDeleting="grvPhones_DeleteRecord" AutoGenerateEditButton="True">
                <Columns>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("DESCRIPTION") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtDescription" runat="server" MaxLength="100" Text='<%# Eval("DESCRIPTION") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date modified">
                        <ItemTemplate>
                            <%# Eval("DATECHANGED")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField HeaderText="Modified by">
                        <ItemTemplate>
                            <%# Eval("CHANGEDBY")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                CommandName="Delete" Text="Delete" ForeColor="Black" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div id="tab-addresses">
            Description:
            <asp:TextBox ID="txtDescriptionAddress" runat="server" MaxLength="100" />
            <asp:LinkButton ID="lnkAddAddress" Text="Add" runat="server" OnClick="lnkAddAddress_Click" />
            <br />
            <br />
            <asp:GridView ID="grvAddresses" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                OnRowEditing="grvAddresses_EditRecord" OnRowUpdating="grvAddresses_UpdateRecord" OnRowDataBound="grvAddresses_RowDataBound"
                OnRowCancelingEdit="grvAddresses_CancelRecord" OnRowDeleting="grvAddresses_DeleteRecord" AutoGenerateEditButton="true">
                <Columns>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("DESCRIPTION") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtDescription" runat="server" MaxLength="100" Text='<%# Eval("DESCRIPTION") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date modified">
                        <ItemTemplate>
                            <%# Eval("DATECHANGED")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField HeaderText="Modified by">
                        <ItemTemplate>
                            <%# Eval("CHANGEDBY")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                CommandName="Delete" Text="Delete" ForeColor="Black" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div id="tab-emailaddresses">            
            Description:
            <asp:TextBox ID="txtDescriptionEmail" runat="server" MaxLength="100" />
            <asp:LinkButton ID="lnkAddEmail" Text="Add" runat="server" OnClick="lnkAddEmail_Click" />
            <br />
            <br />
            <asp:GridView ID="grvEmailAddresses" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                OnRowEditing="grvEmailAddresses_EditRecord" OnRowUpdating="grvEmailAddresses_UpdateRecord" OnRowDataBound="grvEmailAddresses_RowDataBound"
                OnRowCancelingEdit="grvEmailAddresses_CancelRecord" OnRowDeleting="grvEmailAddresses_DeleteRecord" AutoGenerateEditButton="true">
                <Columns>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("DESCRIPTION") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtDescription" runat="server" MaxLength="100" Text='<%# Eval("DESCRIPTION") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date modified">
                        <ItemTemplate>
                            <%# Eval("DATECHANGED")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField HeaderText="Modified by">
                        <ItemTemplate>
                            <%# Eval("CHANGEDBY")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                CommandName="Delete" Text="Delete" ForeColor="Black" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div id="tab-relationships">
            Description:
            <asp:TextBox ID="txtDescriptionRelationship" runat="server" MaxLength="100" />
            <asp:LinkButton ID="lnkAddRelationship" Text="Add" runat="server" OnClick="lnkAddRelationship_Click" />
            <br />
            <br />
            <asp:GridView ID="grvRelationships" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                OnRowEditing="grvRelationships_EditRecord" OnRowUpdating="grvRelationships_UpdateRecord" OnRowDataBound="grvRelationships_RowDataBound"
                OnRowCancelingEdit="grvRelationships_CancelRecord" OnRowDeleting="grvRelationships_DeleteRecord" AutoGenerateEditButton="true">
                <Columns>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("DESCRIPTION") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtDescription" runat="server" MaxLength="100" Text='<%# Eval("DESCRIPTION") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date modified">
                        <ItemTemplate>
                            <%# Eval("DATECHANGED")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField HeaderText="Modified by">
                        <ItemTemplate>
                            <%# Eval("CHANGEDBY")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                CommandName="Delete" Text="Delete" ForeColor="Black" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div id="tab-instruments">
            Description:
            <asp:TextBox ID="txtDescriptionInstruments" runat="server" MaxLength="100" />
            <asp:LinkButton ID="lnkAddInstruments" Text="Add" runat="server" OnClick="lnkAddInstruments_Click" />
            <br />
            <br />
            <asp:GridView ID="grvInstruments" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                OnRowEditing="grvInstruments_EditRecord" OnRowUpdating="grvInstruments_UpdateRecord" OnRowDataBound="grvInstruments_RowDataBound"
                OnRowCancelingEdit="grvInstruments_CancelRecord" OnRowDeleting="grvInstruments_DeleteRecord" AutoGenerateEditButton="true">
                <Columns>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("DESCRIPTION") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtDescription" runat="server" MaxLength="100" Text='<%# Eval("DESCRIPTION") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date modified">
                        <ItemTemplate>
                            <%# Eval("DATECHANGED")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField HeaderText="Modified by">
                        <ItemTemplate>
                            <%# Eval("CHANGEDBY")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                CommandName="Delete" Text="Delete" ForeColor="Black" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div id="tab-manufacturers">            
            Description:
            <asp:TextBox ID="txtDescriptionManufacturers" runat="server" MaxLength="100" />
            <asp:LinkButton ID="lnkAddManufacturers" Text="Add" runat="server" OnClick="lnkAddManufacturers_Click" />
            <br />
            <br />
            <asp:GridView ID="grvManufacturers" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                OnRowEditing="grvManufacturers_EditRecord" OnRowUpdating="grvManufacturers_UpdateRecord" OnRowDataBound="grvManufacturers_RowDataBound"
                OnRowCancelingEdit="grvManufacturers_CancelRecord" OnRowDeleting="grvManufacturers_DeleteRecord" AutoGenerateEditButton="true">
                <Columns>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("DESCRIPTION") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtDescription" runat="server" MaxLength="100" Text='<%# Eval("DESCRIPTION") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date modified">
                        <ItemTemplate>
                            <%# Eval("DATECHANGED")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField HeaderText="Modified by">
                        <ItemTemplate>
                            <%# Eval("CHANGEDBY")%>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                CommandName="Delete" Text="Delete" ForeColor="Black" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
    
    <%--used to keep the user on the correct tab after a postback--%>
    <asp:HiddenField runat="server" ID="hidLastTab" Value="0" /> 
</asp:Content>
